import axios from '../axios'

/**
 * 查询所有成绩
 * @returns {Promise<unknown>}
 */
export const findAll = (data) => {
  return axios({
    url: '/scoreKind/findAll',
    method: 'get',
    params: data
  })
}

/**
 * 分页查询所有成绩
 * @returns {Promise<unknown>}
 */
export const findPage = (data) => {
  return axios({
    url: '/scoreKind/findPage',
    method: 'get',
    params: data
  })
}

/**
 * 通过成绩名称分页查询
 * @returns {Promise<unknown>}
 */
export const findPageByName = (data) => {
  return axios({
    url: '/scoreKind/findPageByName',
    method: 'get',
    params: data
  })
}

/**
 * 添加成绩
 * @param data
 * @returns {Promise<unknown>}
 */
export const add = data => {
  return axios({
    url: '/scoreKind/add',
    method: 'post',
    data
  })
}
/**
 * 更新成绩信息
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const update = data => {
  return axios({
    url: '/scoreKind/update',
    method: 'put',
    data
  })
}
/**
 * 删除成绩
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const del = data => {
  return axios({
    url: '/scoreKind/delete?id=' + data,
    method: 'delete'
  })
}
/**
 * 删除选中成绩
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delAll = data => {
  return axios({
    url: '/scoreKind/deleteAll?ids=' + data,
    method: 'delete'
  })
}
